<?php

/**
 * Midia form.
 *
 * @package    form
 * @subpackage Midia
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 6174 2007-11-27 06:22:40Z fabien $
 */
class MidiaItemForm extends sfForm
{
	public function configure()
	{
		if (!$item = $this->getOption('item'))
			throw new InvalidArgumentException('Você deve instanciar um objeto Item.');

		for ($i = 0; $i < $this->getOption('size', 2); $i++)
		{
			$midia_data = new Midia();
			$midia_data->Item = $item;
				
			$form = new MidiaForm($midia_data);
			$this->embedForm($i, $form);
		}
		$this->mergePostValidator(new MidiaFormValidatorSchema());
	}
}